import { Pool, Client } from 'pg';
import * as config from "config";
const dbConfig: any = config.get('postgresql');

export const sql = new Pool({
    host: dbConfig.host,
    port: dbConfig.port,
    database: dbConfig.database,
    user: dbConfig.username,
    password: dbConfig.password,
    max: 1000,
    idleTimeoutMillis: 10000,
    connectionTimeoutMillis: 2000
});